package com.tjetc.controller;

import com.tjetc.rabbitmq.Sender;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * 测试
 * @author gaoyongxiang
 * @version v1.0
 * @since 2025-11-04
 */
@RestController
public class TestRabbitMQController {

    // 使用Resource 减少耦合度
    @Resource
    private Sender sender;


    // 基础队列
    @GetMapping("/queue")
    public void sendMsg(){
//        System.out.println("send");
        sender.sendMsg();
    }


    // fanout
    @GetMapping("/fanout")
    public void sendFanout(){
        sender.sendFanout();
    }

    // direct
    @GetMapping("/direct1")
    public void sendDirect1(){
        sender.sendDirect1();
    }

    @GetMapping("/direct2")
    public void sendDirect2(){
        sender.sendDirect2();
    }


    // topic
    @GetMapping("/topic1")
    public void sendTopic1(){
        sender.sendTopic1();
    }

    @GetMapping("/topic2")
    public void sendTopic2(){
        sender.sendTopic2();
    }





}
